Skip to content

cmake: Parse ZEPHYR_TOOLCHAIN_VARIANT in SDK instead of Zephyr #998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keith-packard
Copy link
Contributor

@keith-packard keith-packard commented Aug 10, 2025

When ZEPHYR_TOOLCHAIN_VARIANT is of the form toolchain/compiler, it needs to be split into the toolchain (which overwrites ZEPHYR_TOOLCHAIN_VARIANT) and compiler (stored in
TOOLCHAIN_VARIANT_COMPILER).

Otherwise, when defined, it is left alone. When undefined it is set to "zephyr".

Finally, if the value is "zephyr" and no TOOLCHAIN_VARIANT_COMPILER setting is present, then TOOLCHAIN_VARIANT_COMPILER is set to "gnu".

This allows existing configurations which set ZEPHYR_TOOLCHAIN_VARIANT to "zephyr" to work with the new SDK and allows Zephyr to easily support both old and new variable settings during the SDK transition period.

@keith-packard keith-packard force-pushed the sdk-parse-variant branch 3 times, most recently from df2145e to f016697 Compare August 10, 2025 18:36
When ZEPHYR_TOOLCHAIN_VARIANT is of the form toolchain/compiler, it
needs to be split into the toolchain (which overwrites
ZEPHYR_TOOLCHAIN_VARIANT) and compiler (stored in
TOOLCHAIN_VARIANT_COMPILER).

Otherwise, when defined, it is left alone. When undefined it is set to
"zephyr".

Finally, if the value is "zephyr" and no TOOLCHAIN_VARIANT_COMPILER
setting is present, then TOOLCHAIN_VARIANT_COMPILER is set to "gnu".

This allows existing configurations which set ZEPHYR_TOOLCHAIN_VARIANT
to "zephyr" to work with the new SDK and allows Zephyr to easily
support both old and new variable settings during the SDK transition
period.

Finally, write both values into the environment so that Kconfig can
use them.

Signed-off-by: Keith Packard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant